<?php
// +----------------------------------------------------------------------
// | Iecms [ Make the most exquisite CMS ]
// +----------------------------------------------------------------------
// | Copyright (c) 2009~2019 http://www.iemoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: iemoo <i@iemoo.com>
// +----------------------------------------------------------------------
// | DateTime: 2019/11/19 11:08
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

/**
 * 验证器
 * @package app\admin\validate
 */
class Links extends Validate
{
    protected $rule = [
        'links_type_id'		=> 'require|number|gt:0',
		'name'				=> 'require|chsDash',
		'url'				=> 'max:200',
		'description'		=> 'max:200',
		'sort'				=> 'number',
		'status'			=> 'require|number|in:0,1',
    ];

    protected $message = [
        'links_type_id.require'		=> '请选择类型',
		'links_type_id.number'		=> '类型不正确',
        'links_type_id.gt'			=> '类型不正确',
		'name.require'				=> '请输入链接标题',
		'name.chsDash'				=> '链接标题只能是汉字、字母、数字和下划线_及破折号-',
		'url.max'					=> '链接地址过长',
		'description.max'			=> '描述过长',
		'sort.number'				=> '排序不正确',
        'status.require'			=> '请设置广告状态',
		'status.number'				=> '状态不正确',
		'status.in'					=> '状态不正确'
    ];
	

}